<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>尺寸位置</title>
    <script src="../jQuery.js"></script>
    <style>
        div{
            width: 200px;
            height: 200px;
            background-color: green;
            padding: 10px;
            border: 15px solid red;
            margin: 20px;
        }
    </style>
</head>
<body>
    <div></div>
    <script>
$(function(){
    //1.width()/height() 获取设置元素width和height大小
    console.log($("div").width());  //
    //$("div").width(300); //将width修改为300px
    //2.innerWidth() /innerHeight 获取设置元素width和height+padding大小
    console.log($("div").innerWidth());//320
    //3.outerWidth()/outerHeight() 获取设置元素width和height+padding+border大小
    console.log($("div").outerWidth());
    $("div").outerWidth();
    //4.outerWidth(true)/outerHeight(true) 获取设置元素width和height+padding+border+margin大小
    console.log($("div").outerWidth(true));
})
    </script>
</body>
</html>